﻿using Orchard.Environment.Extensions;

namespace ATTools.Models
{
    /// <summary>
    /// The type of the command.
    /// </summary>
    public enum CommandType : byte
    {
        /// <summary>
        /// The command is a go to an url command.
        /// </summary>
        GoToUrl = 0,

        /// <summary>
        /// The command will run custom javascript.
        /// </summary>
        JavaScript = 1
    }

    [OrchardFeature("ATTools.VoiceCommands")]
    public class VoiceCommandRecord //: ContentPartRecord
    {
        /// <summary>
        /// The Id of the command record.
        /// </summary>
        public virtual int Id { get; set; }

        /// <summary>
        /// Represent the prefix to trigger the command.
        /// </summary>
        public virtual string Description { get; set; }

        /// <summary>
        /// The Type of the command. The byte representation of <see cref="ATTools.Models.CommandType">CommandType</see>.
        /// </summary>
        public virtual byte CommandType { get; set; }

        /// <summary>
        /// The argument to the command. JavaScript if JavaScript type, and some url with {value} if GoToUrl type is used.
        /// </summary>
        public virtual string CommandData { get; set; }
    }
}